package com.msmall.community.admin.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.msmall.base.model.BaseObject;


@Entity
@Table(name="admin_role")
public class AdminRole extends BaseObject{

	private static final long serialVersionUID = -8926825590223691424L;

	@Id
	@Column(name="role_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long roleId;

	@Column(name="description")
	private String description;
	
	@Column(name="name")
	private String name;

	@ManyToMany
	@JoinTable(name="admin_role_user",
		joinColumns=@JoinColumn(name="role_id"),
		inverseJoinColumns=@JoinColumn(name="user_id"))
	private Set<AdminUser> adminUserCollection;

	@ManyToMany(mappedBy="adminRoleCollection")
	private Set<AdminResc> adminRescCollection;

	public AdminRole() {
		super();
	}

	public Long getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<AdminUser> getAdminUserCollection() {
		return this.adminUserCollection;
	}

	public void setAdminUserCollection(Set<AdminUser> adminUserCollection) {
		this.adminUserCollection = adminUserCollection;
	}

	public Set<AdminResc> getAdminRescCollection() {
		return this.adminRescCollection;
	}

	public void setAdminRescCollection(Set<AdminResc> adminRescCollection) {
		this.adminRescCollection = adminRescCollection;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}
